package com.forum.article.mapper;

import com.forum.article.entity.ForumArticleTag;
import com.forum.article.entity.ForumArticleTagMap;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.forum.article.vo.HotTagVo;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author bncgnc
 * @since 2022-01-04
 */
@Repository
public interface ForumArticleTagMapMapper extends BaseMapper<ForumArticleTagMap> {

    @Select("select article_tag_id , count(article_tag_id) as c from forum_article_tag_map group by article_tag_id order by c DESC limit 5")
    List<HotTagVo> selectHotTag(int limit);

}
